Draft
Conversation
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
Saadnajmi
added a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Apr 2, 2026
Port the shared changes from facebook#56298: - Add onAuxClick/onAuxClickCapture to TouchEventEmitter (shared C++) - Add AuxClick/AuxClickCapture to ViewEvents in primitives.h - Add prop conversions in propsConversions.h - Register topAuxClick as a bubbling event in BaseViewConfig.ios.js - Add dispatch logic in RCTSurfacePointerHandler.mm (iOS path) - Type onAuxClick as PointerEvent in PointerEventProps (Flow + TS) Remove redundant macOS-specific JS registrations since macOS now inherits the bubbling event from the iOS base config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Saadnajmi
added a commit
to Saadnajmi/react-native-macos
that referenced
this pull request
Apr 8, 2026
Port the shared changes from facebook#56298: - Add onAuxClick/onAuxClickCapture to TouchEventEmitter (shared C++) - Add AuxClick/AuxClickCapture to ViewEvents in primitives.h - Add prop conversions in propsConversions.h - Register topAuxClick as a bubbling event in BaseViewConfig.ios.js - Add dispatch logic in RCTSurfacePointerHandler.mm (iOS path) - Type onAuxClick as PointerEvent in PointerEventProps (Flow + TS) Remove redundant macOS-specific JS registrations since macOS now inherits the bubbling event from the iOS base config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Saadnajmi
added a commit
to microsoft/react-native-macos
that referenced
this pull request
Apr 9, 2026
## Summary Backport of #2885 to 0.81-stable. - Add `onAuxClick` event for right-click and middle-click handling on macOS - Add `onClick` event for left single-click on plain Views - Fix `onAuxClick` prop registration in iterator-based setProp path - Override `rightMouseDown:` to prevent context menu modal from stealing `rightMouseUp:` - Add `otherMouseDown:`/`otherMouseUp:` for middle-click support - Prevent Pressable visual press feedback on non-primary mouse buttons - Align with upstream facebook#56298 (shared cross-platform changes) ## Test plan - Left-click on View → fires `onClick` with `button=0` - Double-click on View → fires `onDoubleClick` with `button=0` - Right-click on View → fires `onAuxClick` with `button=2` - Middle-click on View → fires `onAuxClick` with `button=1` - Right-click on Pressable → fires `onAuxClick`, does NOT trigger `onPress` or visual press state 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Saadnajmi
added a commit
to microsoft/react-native-macos
that referenced
this pull request
Apr 9, 2026
## Summary - Implements `onAuxClick` event, matching the upstream implementation in [facebook#56298](facebook#56298) - **Shared changes (from upstream):** Adds `onAuxClick`/`onAuxClickCapture` to `TouchEventEmitter`, `ViewEvents` (`primitives.h`), `propsConversions.h`, `BaseViewConfig.ios.js` (bubbling event), `RCTSurfacePointerHandler.mm` (iOS dispatch), and `PointerEventProps` types - **macOS-specific changes:** Since macOS doesn't use `RCTSurfacePointerHandler.mm` (guarded with `#if !TARGET_OS_OSX`), adds native wiring through `RCTViewComponentView.mm` (`rightMouseUp:` → `HostPlatformViewEventEmitter::onAuxClick`) - Adds a `button` field to the macOS `MouseEvent` struct (W3C spec: 0=left, 1=middle, 2=right) - Filters non-primary button clicks from triggering `onPress` in `Pressability`, so right-clicking a `Pressable` no longer fires its press handler ## Test plan Event log matches my button presses <img width="939" height="966" alt="Screenshot 2026-04-08 at 3 38 45 PM" src="https://github.com/user-attachments/assets/a31c01d4-bfa1-440e-998d-bfd194b6f2f7" /> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Changelog:
Test Plan: